// Xampler, a MIDI-driven sampler
// Copyright (C) 2006 Nick Thomas
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 USA.

#ifndef XAMPLER_SAMPLE_STRIP_HPP
#define XAMPLER_SAMPLE_STRIP_HPP

#include "Sample.hpp"
#include <gtkmm/box.h>
#include <gtkmm/entry.h>
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/image.h>
#include <gtkmm/scale.h>

namespace xampler
{
    class SampleStrip : public Gtk::HBox
    {
    public:
        SampleStrip();
        void set_sample(Sample &sample);
        void increment_playing_count();
        void decrement_playing_count();

    private:
        void set_led_on(bool state);
        void on_sample_name_changed();
        void on_volume_slider_changed();
        void on_balance_slider_changed();
        void on_load_button_clicked();

        int m_playing_count;
        Sample *m_sample;
        Gtk::Entry m_sample_name;
        Gtk::HScale m_volume_slider;
        Gtk::HScale m_balance_slider;
        Gtk::Button m_load_button;
        Gtk::Image m_led;

        static bool m_static_members_initialized;
        static Gtk::FileFilter *m_filter_sound;
        static Gtk::FileFilter *m_filter_any;
    };
}

#endif
